package com.example.demo.module.sofarpc.server;

import com.alipay.sofa.rpc.config.ProviderConfig;
import com.alipay.sofa.rpc.config.ServerConfig;
import com.example.demo.module.sofarpc.service.HelloService;
import com.example.demo.module.sofarpc.service.impl.HelloServiceImpl;

/**
 * @author lufei
 * @version 1.0
 * @created 18-5-14
 */
public class SofaRpcServer {
    public static void main(String[] args) {
        ServerConfig serverConfig = new ServerConfig()
                .setProtocol("bolt")
                .setPort(12200)
                .setDaemon(false);

        ProviderConfig providerConfig = new ProviderConfig<HelloService>()
                .setInterfaceId(HelloService.class.getName())
                .setRef(new HelloServiceImpl())
                .setServer(serverConfig);

        System.out.println(providerConfig.getProxyClass());
        providerConfig.export();
    }

}
